using UnityEngine;
using UnityEngine.Audio;

public class ConfigBase : ScriptableObject
{
	public enum GGFileIOCloudSyncTypes
	{
		WhisperSync = 0,
		GGCloudSync = 1,
		GGSaveLocalOnly = 2,
		GGSnapshotCloudSync = 3
	}

	public enum SocialProvider
	{
		GooglePlayServices = 0,
		AmazonGameCircle = 1
	}

	public enum InAppProvider
	{
		GooglePlayServices = 0,
		AmazonInApp = 1
	}

	public bool debug;

	public bool useProfilePictureInMultiplayer;

	[Header("Facebook")]
	public string facebookAppId = "752983338151813";

	public string facebookLoginPermissions = "public_profile, user_friends";

	public string facebookDisplayName;

	public bool disableFacebookLoginIOS;

	[Header("Facebook Testing")]
	public string facebookTestAccessToken = "CAAKs1b0mBXIBAL30WYTgiDUD4Ok9fbZBGPxz76FWxcHZBGs1XqkWOgm9uOKxjtvuk3byE9WSNtwwXJy5rY7C3k7qZBLSClZAPRHkyilRmc0nWgRirGMFZBRkmJhzKt0YdOFpZAJmrJvtXRD22YUYiw0rWPj4up8h61MRVLTjXTrzuIdLVZBoLrxF8fKYmybFskoLdtalTn0TX3fAqPxZByd5";

	[Header("Snapshot Cloud Sync")]
	public float cloudSyncTimeDelay = 30f;

	public float cloudSyncTimeDelayWhenRequestFails = 120f;

	public int maxSyncFrequency = 10;

	public Material adsMaterial;

	public string styleName;

	public string appName;

	public string inAppAdsName;

	public string matchServerUrl;

	public string matchServerApp;

	public int maxDisconnects = 2;

	public string rankingsServerUrl;

	public string rankingsApp;

	public string iosAppId;

	public string proVersionPackage;

	public string activeConfig;

	public bool useHttpsForAdBundles;

	public string activeConfigIOS;

	public string activeConfigWinRT;

	public bool tournamentsOnlyAvailableInPro;

	public bool noWaitingInPro;

	public string leaderboardId;

	public bool isProVersion;

	public bool canUseRate;

	public bool gameCenterAvailable;

	public string rateProvider;

	public bool inAppAvailable;

	public bool verifyPlayInApp;

	public bool testingInAppPurchases;

	public bool useGiftiz;

	public bool allDifficultiesInPro;

	public bool canUseFacebook;

	public string menuSceneName = "Assets/Scenes/MenuSceneDemo.unity";

	public GGFileIOCloudSyncTypes cloudSyncType;

	public string gameCenterCategory;

	public string mopubId;

	public string suggestionUrl;

	public string bugReportUrl;

	public SocialProvider socialProvider;

	public InAppProvider inAppProvider;

	public string interstitialAdId;

	public string amazonAppKey;

	public bool noAdsOnPromotionDay;

	public int promotionCoins;

	public string promotionStart;

	public string promotionEnd;

	public string promotionMessage;

	private static ConfigBase _instance;

	public int notificationLatestTime = 22;

	public int notificationEarliestTime = 9;

	public AudioMixer masterMixer;

	public int minAudioVal = -80;

	public int maxAudioVal;

	public int initialVolumeLevel = 50;

	public string facebookError = "100";

	public float multiplayerSkillPointsScale = 1f;

	public float multiplayerSkillPointsOffset;

	public int coinsCap = 100000000;

	public int tokensCap = 100000;

	public int ggDollarsCap = 100000000;

	public int eloCap = 9999;

	public int freeCoins = 50;

	public int coinsForLike = 50;

	public string appNameForDisplay;

	public CurrencyType freeCoinsCurrencyType = CurrencyType.diamonds;

	public bool shouldShowAmazonAds
	{
		get
		{
			return !string.IsNullOrEmpty(amazonAppKey);
		}
	}

	public bool isProVersionEnabled
	{
		get
		{
			return isProVersion;
		}
	}

	public bool isProVersionAvailable
	{
		get
		{
			return proVersionPackage != null;
		}
	}

	public static ConfigBase instance
	{
		get
		{
			if (_instance == null)
			{
				_instance = Resources.Load("Config", typeof(ConfigBase)) as ConfigBase;
				if (_instance.activeConfig != null)
				{
					ConfigBase configBase = Resources.Load(_instance.activeConfig, typeof(ConfigBase)) as ConfigBase;
					if (configBase != null)
					{
						_instance = configBase;
					}
				}
			}
			return _instance;
		}
	}

	public bool IsSyncEnabledInCurrentScene()
	{
		if (string.IsNullOrEmpty(menuSceneName))
		{
			return true;
		}
		return Application.loadedLevelName == instance.menuSceneName;
	}

	public string GetSuggestionUrl(string playerName, string appName, string pid = "")
	{
		string text = suggestionUrl;
		string text2 = text;
		text = text2 + "?player_name=" + playerName + "&game=" + appName;
		if (!string.IsNullOrEmpty(pid))
		{
			text = text + "&player_id=" + pid;
		}
		return text;
	}

	public string GetBugReportUrl(string playerName, string appName, string pid = "")
	{
		string text = bugReportUrl;
		string text2 = text;
		text = text2 + "?player_name=" + playerName + "&game=" + appName;
		if (!string.IsNullOrEmpty(pid))
		{
			text = text + "&player_id=" + pid;
		}
		return text;
	}

	public string GetMatchServerAppName()
	{
		return matchServerApp + ((!debug) ? string.Empty : "testing");
	}
}
